from .relys import BitSet
from .relys import Chip

class Display(Chip):
    def __init__(self, width):
        super().__init__(width+2, [0, width+2],[2,width+2])
        self.DIS = self.pinIN@[0,2]
        self.DAT = self.pinIN@[2,width+2]
        self._dat = self.DAT
    def __show__(self):
        if self.DIS() == 0 : form = "{:<u>}"
        elif self.DIS() == 1 : form = "{:<d>}"
        elif self.DIS() == 2 : form = "{:<X>}"
        elif self.DIS() == 3 : form = "{:<c>}"
        print(form.format(self._dat()))

@Display.keyframe(-1)
def _frame(chip):
    pass
